package com.itheima.web;

import com.itheima.entity.Result;
import com.itheima.service.SetmealService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/setmeal")
public class SetmealController {

    @Reference
    private SetmealService setmealService;

    @GetMapping("/findAll")
    public Result findAll(){
        return new Result(setmealService.findAll());
    }

    @GetMapping("/getDetail/{id}")
    public Result getDetail(@PathVariable("id") Long id){
        return new Result(setmealService.getDetail(id));
    }

    @GetMapping("/getInfo/{id}")
    public Result getInfo(@PathVariable("id") Long id){
        return new Result(setmealService.getInfo(id));
    }

}
